/*
 * @Author: your name
 * @Date: 2021-12-12 22:06:25
 * @LastEditTime: 2022-04-10 20:58:17
 * @LastEditors: Please set LastEditors
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: /visualNotes/src/modules/Home/components/header.tsx
 */
import React from "react";
import { Button } from "antd";
import { useHistory } from "react-router-dom";
import { routerPath } from "@/routers";
import { UserDTO } from "@/service/users";
import style from "./index.module.less";
import "./index.less";
interface IProps {
  user?: UserDTO;
}
const Header = (props: IProps) => {
  const history = useHistory();
  const { user } = props;
  return (
    <div className={style.container}>
      <div className={style.title}>SysML系统建模工具箱</div>
      <div className={style.desc}>这是一款服务于大学生的SysML在线工具集</div>
      <Button
        disabled={!user?.role}
        className={style.button}
        onClick={() => {
          history.push(routerPath.tools);
        }}
      >
        <span className={style.buttonWord}>新建项目</span>
      </Button>
      <br />
      <Button
     disabled={!user?.role}
     className={style.button}
        onClick={() => {
          history.push(routerPath.projects);
        }}
      >
        <span className={style.buttonWord}>我的项目</span>
      </Button>
      <br />
      <Button
     disabled={!user?.role}
     className={style.button}
        onClick={() => {
          history.push(routerPath.tutorial);
        }}
      >
        <span className={style.buttonWord}>工具教程</span>
      </Button>
      <br />
      <Button
     disabled={!user?.role}
     className={style.button}
        onClick={() => {
          history.push(routerPath.tutorial);
        }}
      >
        <span className={style.buttonWord}>反馈提交</span>
      </Button>
    </div>
    
  );
};
export default Header;
